package com.woniuxy.redis.server;


import java.io.IOException;
import java.io.InputStream;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * @Author: 马宇航
 * @Do: 在服务端，模拟一个redis的服务，来拦截你正常发往redis的信息
 * @DateTime: 22/05/26/0026 下午 4:18
 * @Component: 成都蜗牛学苑
 **/
public class InterceptorRedisMessage {
    public static void main(String[] args) throws IOException {
        ServerSocket serverSocket = new ServerSocket(6379);
        Socket accept = serverSocket.accept();
        byte[] message = new byte[2021];
        InputStream inputStream = accept.getInputStream();
        inputStream.read(message);
        System.out.println(new String(message));
//        accept.close();
//        serverSocket.close();
    }
}
